package org.dromara.business.modules.contactForm.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.business.modules.contactForm.domain.BuContactForm;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.hibernate.validator.constraints.Length;

/**
 * 联系消息业务对象 bu_contact_form
 *
 * @author ckk
 * @date 2025-11-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BuContactForm.class, reverseConvertGenerate = false)
public class BuContactFormBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 分类（0：需求，1：服务）
     */
    @NotNull(message = "分类不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer category;

    /**
     * 外键id
     */
    @NotNull(message = "外键id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long relatedId;

    /**
     * 内容
     */
    @NotBlank(message = "内容不能为空", groups = { AddGroup.class, EditGroup.class })
    @Length(max = 500, message = "内容长度不能超过500个字符")
    private String contactContent;

    /**
     * 附件
     */
    private String attachment;

    /**
     * 联系人
     */
    @NotBlank(message = "联系人不能为空", groups = { AddGroup.class, EditGroup.class })
    private String contactPerson;

    /**
     * 联系电话
     */
    @NotBlank(message = "联系电话不能为空", groups = { AddGroup.class, EditGroup.class })
    @Pattern(regexp = "^1[3-9]\\d{8}$", message = "手机号码格式不正确")
    private String contactPhone;

    /**
     * 是否已读（0：否，1：是）
     */
    private Integer hasRead;


}
